import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../components/Login'
import adminIndex from "@/components/admin/adminIndex";
import home from "@/components/admin/home";
import studentInfo from "@/components/admin/studentInfo";
import menuInfo from "@/components/admin/menuInfo";
import orderInfo from "@/components/admin/orderInfo";
import dicInfo from "@/components/admin/dicInfo";
import dicMapperInfo from "@/components/admin/dicMapperInfo";
import userLogin from "@/components/userLogin";
import userIndex from "@/components/front/userIndex";
import menus from "@/components/front/menus";
import card from "@/components/front/card";
import order from "@/components/front/order";
import message from "@/components/front/message";
import aliPay from "@/components/front/ali-pay";
import updateMsg from "@/components/front/updateMsg";
import register from "@/components/register";
Vue.use(VueRouter)

const routes = [
  {
    path: '/admin',
    name: 'login',
    component: Login
  },
  {
    path: '/adminIndex',
    name: 'adminindex',
    component: adminIndex,
    redirect: '/home',
    children: [
      {path: '/home', component: home},
      {path: '/studentInfo', component: studentInfo},
      {path: '/menuInfo', component: menuInfo},
      {path: '/orderInfo', component: orderInfo},
      {path: '/dicInfo', component: dicInfo},
      {path: '/dicMapperInfo', component: dicMapperInfo}
    ]
  },
  {
    path: '/',
    name: 'userLogin',
    component: userLogin
  },
  {
    path: '/register',
    name: 'register',
    component: register
  },
  {
    path:'/index',
    name:'index',
    component: userIndex,
    redirect: '/message',
    children: [
      {path: '/menus', component: menus},
      {path: '/card', component: card},
      {path: '/order',name:'order', component: order},
      {path: '/message', component: message},
      {
        path: '/pay',
        name: 'pay',
        component: aliPay
      },
      {path:'/update',component: updateMsg}
    ]
  }

]

const router = new VueRouter({
  routes
})

export default router
